package cc.shacocloud.luanniao.core.repository

import cc.shacocloud.luanniao.core.model.constant.UserAuthRoleEnum
import cc.shacocloud.luanniao.core.model.po.UserPo
import org.springframework.data.r2dbc.repository.R2dbcRepository
import org.springframework.stereotype.Repository
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono

/**
 *
 * @author 思追(shaco)
 */
@Repository
interface UserRepository : R2dbcRepository<UserPo, Long> {

    fun findByUsername(username: String): Mono<UserPo>

    fun findByRole(role: UserAuthRoleEnum): Flux<UserPo>

    fun deleteByRole(role: UserAuthRoleEnum): Mono<Long>
}